home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
SHARED.DIR
/
03087_Script_TRANSITIONS
< prev
next >
Wrap
Text File
|
1996-04-01
|
2KB
|
51 lines
-- -----------------------------------------------------------
-- Handler getTransitionNumber returns the number of the given
-- doTransition. This version uses binary search.
on getTransitionNumber whichTransition
set allTransitions = field "Transitions"
set transitionLine = binSearchFirstItemInLine(allTransitions, whichTransition, ":")
-- Error Handling
if (transitionLine = 0) then
errorAlert("TRANSITION NOT FOUND")
end if
set the itemDelimiter = ":"
set transitionNumber = value(item 2 of line transitionLine of allTransitions)
set the itemDelimiter = ";"
return transitionNumber
end
-- -----------------------------------------------------------
-- Handler doTransition performs the given doTransition
-- in the given time.
on doTransition whichTransition, time, chunkSize
put getTransitionNumber(whichTransition) into theTransition
if voidP(chunkSize) then
puppetTransition theTransition, time
else
puppetTransition theTransition, time, chunkSize
end if
end
-- -----------------------------------------------------------
-- setting up the transition field.
on sortField whichField
set unsortedData = field whichField
set sortedData = []
repeat with i = 1 to the number of lines in unsortedData
set currentLine = line i of unsortedData
add (sortedData, currentLine)
end repeat
sort sortedData
repeat with i = 1 to count(sortedData)
put getAt(sortedData,i) into line i of field whichField
end repeat
end